# Maintainer:  Federico Cinelli   <cinelli@aur.archlinux.org>

pkgname=gpsmanshp
pkgver=1.2.3
pkgrel=4
pkgdesc="A Tcl package to read and write shapefiles"
arch=('loong64' 'x86_64')
url="http://gpsmanshp.sourceforge.net/"
license=('GPL')
depends=('glibc' 'shapelib' 'tcl')
source=("https://sourceforge.net/projects/$pkgname/files/distr/${pkgname}_$pkgver.tgz")
md5sums=('ae25451d75c6c2b281074e13c1da29cd')

prepare() {
  cd "${pkgname}_$pkgver"
  sed -i "s|8.4|8.6|g" Makefile8.5
}

build() {
  cd "${pkgname}_$pkgver"
  make -f Makefile8.5 TCLVERSION=8.6
}

package() {
  cd "${pkgname}_$pkgver"
  install -d "$pkgdir"/usr/lib/gpsmanshp
  make -f Makefile8.5 TCLVERSION=8.6 INSTALLDIR="$pkgdir"/usr/lib/gpsmanshp install
}
